<?php echo $this->fetch('header.html'); ?>
<div> 
<?php echo $this->fetch('kcorder/nav.html'); ?>
<form method="get" action="<?php echo $this->_var['appadmin']; ?>">
<input type="hidden" name="m" value="kcorder" />
<input type="hidden" name="a" value="default" />
<p>
订单号：<input type="text" name="orderno" value="<?php echo $_GET['orderno']; ?>" />
<?php $this->assign("kclist",M("kucun")->select(array("where"=>"1"))); ?>
供应商：<select name="kcid" class="w100">
<option value="0">请选择</option>
<?php $_from = $this->_var['kclist']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?> 
<option value="<?php echo $this->_var['c']['kcid']; ?>" <?php if (get ( 'kcid' ) == $this->_var['c']['kcid']): ?> selected="selected"<?php endif; ?>><?php echo $this->_var['c']['title']; ?></option>
<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
</select>
状态：<select name="s_status" class="w100">
<option value="-1">请选择</option>
<?php $_from = $this->_var['order_status_list']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('k', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['k'] => $this->_var['c']):
?>
<?php if ($this->_var['k'] < 99): ?><option value="<?php echo $this->_var['k']; ?>" <?php if ($_GET['s_status'] == $this->_var['k']): ?> selected="selected" <?php endif; ?>><?php echo $this->_var['c']; ?></option><?php endif; ?>
<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
</select>
<?php $this->assign("sites",M("sites")->select(array("where"=>"1"))); ?>
学校：<select name="siteid" class="w100">
<option value="0">请选择</option>
<?php $_from = $this->_var['sites']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?> 
<option value="<?php echo $this->_var['c']['siteid']; ?>" <?php if (get ( 'siteid' ) == $this->_var['c']['siteid']): ?> selected="selected"<?php endif; ?>><?php echo $this->_var['c']['sitename']; ?></option>
<?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
</select>
<br />
店铺类型：<select name="typeid">
<option value="0">请选择</option>
<option value="1" <?php if (get ( 'typeid' ) == 1): ?> selected<?php endif; ?>>夜猫店</option>
<option value="2" <?php if (get ( 'typeid' ) == 2): ?> selected<?php endif; ?>>口袋店</option>
</select>
店铺：<input type="text" name="shopname"  value="<?php echo $_GET['shopname']; ?>">
 
开始时间：<input type="text" name="start_time" value="<?php echo $_GET['start_time']; ?>"  onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" />
结束时间：<input type="text" name="end_time" value="<?php echo $_GET['end_time']; ?>"   onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" />


<input type="submit" value="搜索" class="btn btn-warning" />
</p>
</form>
 <table class='table table-bordered' width='100%'>
  <tr>
   <td>orderno</td>
   
   <td>库存</td> 
  <td>店铺</td>
   <td>下单时间</td>
   <td>联系人</td>
   <td>电话</td>
   <td>地址</td>
   <td>金额</td>
   <td>状态</td>
   <td>支付</td>
   
<td>操作</td>
  </tr>
 <?php $_from = $this->_var['data']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?>
<tr>
 <td><?php echo $this->_var['c']['orderno']; ?></td>
 <td><?php echo $this->_var['c']['kc_title']; ?></td>
   <td>[<?php if ($this->_var['c']['typeid'] == 1): ?>夜猫<?php else: ?>口袋<?php endif; ?>]<?php echo $this->_var['c']['shop_name']; ?></td>
   
    
   <td><?php echo date("Y-m-d",$this->_var['c']['dateline']); ?></td>
   <td><?php echo $this->_var['c']['nickname']; ?></td>
   <td><?php echo $this->_var['c']['telephone']; ?></td>
   <td><?php echo $this->_var['c']['sitename']; ?> <?php echo $this->_var['c']['address']; ?></td>
   <td><?php echo $this->_var['c']['money']; ?></td>
   <td><?php echo $this->_var['order_status_list'][$this->_var['c']['status']]; ?></td>
   <td><?php if ($this->_var['c']['ispay'] == 2): ?>已支付<?php else: ?>未支付<?php endif; ?></td>
   
<td>  <a href="<?php echo $this->_var['appadmin']; ?>?m=kcorder&a=show&order_id=<?php echo $this->_var['c']['order_id']; ?>&typeid=<?php echo $this->_var['c']['typeid']; ?>">查看</a>  </td>
  </tr>
   <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
 </table>
<div><?php echo $this->_var['pagelist']; ?></div>
</div> 
<script language="javascript" src="/plugin/My97DatePicker/WdatePicker.js"></script>
<?php echo $this->fetch('footer.html'); ?>